package AdapterModel;

public class AmbulanceAdapter extends CarController{
    private AmbulanceSound ambulanceSound;
    private AmbulanceLamp ambulanceLamp;

    public AmbulanceAdapter(AmbulanceSound ambulanceSound, AmbulanceLamp ambulanceLamp) {
        this.ambulanceSound = ambulanceSound;
        this.ambulanceLamp = ambulanceLamp;
    }
    public AmbulanceAdapter(){
        this.ambulanceSound=new AmbulanceSound();
        this.ambulanceLamp=new AmbulanceLamp();
    }

    @Override
    public void phonate() {
        ambulanceSound.alarmLamp();
    }

    @Override
    public void twinkle() {
        ambulanceLamp.lighting();
    }
}